<template>
   <div class="myassets">
    <div class="trademain">
      <el-row :gutter="20" class="hidemenu">
        <el-col :span="3" class="hidetext">
            隐藏菜单
        </el-col>
    </el-row>
    <!-- 出证 -->
    <el-row :gutter="20">
        <el-col :span="4" class="chutext">
            我的藏品
        </el-col>        
    </el-row>
    <el-col :span="4" class="chutext">
            我的id:{{userid }}
        </el-col> 
    <!-- 交易主体 -->
      <el-row :style="{'margin-top':'30px'}" v-for="(o) in line" :key=o>
        <el-col :span="3" v-for="(o, index) in myassets" :key="o" :offset="index > 0 ? 1 : 0">
          <el-card :body-style="{ padding: '0px','margin-top':'0px'}"  shadow="hover">
            <el-image
              @click="skiproute(o)"
              style="width: 150px; height: 120px"
              :src="baseurl+o.name"
              :fit="fit">
            </el-image>
              <div style="padding: 14px;">
              <div class="bottom clearfix">
                <span>{{o.name}}</span>
              </div>
            </div>
          </el-card>
      </el-col>
      </el-row>
      <!--分页  -->
      <el-pagination
        background
        layout="prev, pager, next"
        :total="1000">
      </el-pagination>
    </div>
   </div>
</template>

<script>
import axios from 'axios';
export default {
    name:'myassets',
    data(){
        return{
            myassets:[],
              // 表示要展示行数数
                line:1,
                baseurl:"http://hatelys.vipgz1.91tunnel.com/trade/hdfsimg/",
                fit:"cover",
                userid:window.localStorage.getItem('userid')
        }
    },
    methods:{
        queryassetsbyowner(){
            axios({
                method:"get",
                url:"http://hatelys.vipgz1.91tunnel.com/myassets/queryassetbyowner",
                params: {
                  userid:window.localStorage.getItem('userid')
                },
                headers:{
                    'Content-Type':'application/json;charset=UTF-8',
                    'Authorization':'Bearer '+localStorage.getItem('token')
                },
            }).then(resp=>{ 
              console.log(resp);
              this.myassets = resp.data.data
            }) 
        },
        skiproute(o){
        console.log("触发点击"+o.id);
        // console.log(this.$router.push());
        this.$router.push({
            path:'/ceshi/mydetaileddisplay',
            query: { 
            name: o.name,
            time:o.time,
            id:o.id,
            owner:o.owner,
            userid:o.userid,
            appraisedvalue:o.appraisedvalue
            },
            deep:true
      })

    }
    },
    beforeMount(){
        this.queryassetsbyowner()
    }
}
</script>

<style>

</style>